﻿using erpWebapiBack.ApplicationDev.mytest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace erpWebapiBack.WebApi.Controllers
{
    
    public class HomeController : Controller
    {
        mytestIBLL mytestIBLL = new mytestBLL();

        public ActionResult Index()
        {
            //获取主键获取
            //mytestEntity entity= mytestIBLL.GetMytestEntity("1");

            //Func 委托
            //mytestEntity entity = mytestIBLL.GetMytestEntity("1", "xm");

            //插入一个
            //mytestEntity entity = new mytestEntity();
            //entity.mid = "10";
            //entity.mname = "test";
            //entity.mage = 12;

            //int insertadd= mytestIBLL.InsertMytest(entity);

            //插入多个
            //mytestEntity entity = new mytestEntity();
            //entity.mid = "13";
            //entity.mname = "test";
            //entity.mage = 12;

            //mytestEntity entity1 = new mytestEntity();
            //entity1.mid = "14";
            //entity1.mname = "test2";
            //entity1.mage = 13;

            //IEnumerable<mytestEntity> mytestEntities = new mytestEntity[] { entity, entity1 };

            //int insertadd = mytestIBLL.InsertBranchMytest(mytestEntities);


            //修改一个
            //mytestEntity entity = new mytestEntity();
            //entity.mid = "13";
            //entity.mname = "test13";
            //entity.mage = 12;
            //int updatexx = mytestIBLL.UpdateMytest(entity);

            //删除一个
            //mytestEntity entity = new mytestEntity();
            //entity.mid = "13";
            //int delxx = mytestIBLL.DeleteMytest(entity);

            //删除多个
            //mytestEntity entity = new mytestEntity();
            //entity.mid = "8";

            //mytestEntity entity1 = new mytestEntity();
            //entity1.mid = "9";

            //IEnumerable<mytestEntity> mytestEntities = new mytestEntity[] { entity, entity1 };
            //int delxx = mytestIBLL.DeleteBranchMytest(mytestEntities);

            //SQL 查询
            //IEnumerable<mytestEntity> mytestEntities = mytestIBLL.GetMytestEntities("");

            //SQL 更新
            //int sqlup = mytestIBLL.ExecSqlUpdateData("1", "100");

            ViewBag.Title = "Home Page";

            return View();
        }
               
        public string GetReq()
        {
            return "";
        }
    }
}
